<?php
/**
 * Created by PhpStorm.
 * User: 伟鑫
 * Date: 2019/3/11
 * Time: 16:49
 */

namespace app\admin\controller;


use app\admin\model\ShifuModel;
use think\Db;
use think\Request;

class Fuwushang extends Base
{
    public function index(Request $request){
        $where = [];
        $param = $request->param();
        if (isset($param['real_name']) && !empty($param['real_name'])) $where['real_name'] = ['like','%'.$param['real_name'].'%'];
        if (isset($param['phone']) && !empty($param['phone'])) $where['phone'] = $param['phone'];
        if (isset($param['prohibit']) && !empty($param['prohibit'])) $where['prohibit'] = $param['prohibit'];
        $where['type'] = 2;
        $data = Db::name('member')->where($where)->paginate(10);
        $this->assign('list',$data);
        return $this->fetch();
    }

    public function info(Request $request){
        $info = ShifuModel::get($request->param('id'));
        $this->assign('info',$info);
        return $this->fetch();
    }

    public function edit(Request $request){
        if ($request->isAjax()){
            return (new ShifuModel())->edit();
        }
    }

}